<?php
$mcontent = '';

//$var = (!get_magic_quotes_gpc()) ? addslashes(@$_GET['p']) : @$_GET['p'];
//$temp = getURLParams($var);

if ( empty($paramsArr['aid']) )
	$mcontent .= 'Đang cập nhật !';
else
{
	$sql = "SELECT article.*,topic.tname FROM article,topic WHERE topic.tid=article.tid AND autoid=". $paramsArr['aid'] . " order by datepost desc,autoid desc";

	$rs_notice = $link->execute($sql);
	
	if ( !$rs_notice->EOF )
	{
		$mcontent .= '<br />';
		$mcontent .= '<div class="news" style="padding-bottom: 10px">' . $rs_notice->fields('title') . ' <font color="#CCCCCC">[' . ToVNDate($rs_notice->fields('datepost')) . ']</font></div>';
                                          $mcontent .= '<div align="justify">';
		if ( $rs_notice->fields('picture') == 0 )
			$mcontent .= $rs_notice->fields('full_content');
		else
		{
			$mcontent .= '<img src="images.php?imgid=' . $rs_notice->fields('picture') . '" border="0" align="top" style="float:left">';
			$mcontent .= $rs_notice->fields('full_content');
		}
		$mcontent .= '</div>';
		$tid = $rs_notice->fields('tid');
		
		$rs_notice->close();
	}
	else
	{
		$mcontent .= headerSD('LỖI !!!','#CC6600','1');
	}
	$rs_notice->close();
	
	$template->set_filenames(array(
		'print'=>'print.tpl'
	));
	
	$template->assign_vars(array(
		'T_PRINT_CONTENT'=>$mcontent,
		'T_SITENAME' => $info['sitename'],
		'T_CHARSET' => $info['charset'],
		'T_STYLE_PATH' => $info['style_path'],
		'T_IMAGE_PATH' => $info['template_image_path'],
		'T_PRINT_NOIDANG'=>$lang['l_print_noidang']
	));
	
	$template->pparse('print');
}
?>